package club.zhilin.guli.service.edu.controller.portal;

import club.zhilin.guli.common.base.result.CommonResult;
import club.zhilin.guli.service.edu.domain.vo.SubjectVO;
import club.zhilin.guli.service.edu.service.ISubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhilin
 * @since 2022/2/15 16:38
 */
@Api(tags = "课程分类")
@RestController
@RequestMapping("/portal/edu/subject")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PortalSubjectController {

    private final ISubjectService iSubjectService;

    @ApiOperation("嵌套数据列表")
    @GetMapping("/nestedList")
    public CommonResult<List<SubjectVO>> nestedList() {
        return CommonResult.success(iSubjectService.nestedList("0"));
    }
}
